1 /*
2 
3 Boost Software License - Version 1.0 - August 17th, 2003
4 
5 Permission is hereby granted, free of charge, to any person or organization
6 obtaining a copy of the software and accompanying documentation covered by
7 this license (the "Software") to use, reproduce, display, distribute,
8 execute, and transmit the Software, and to prepare derivative works of the
9 Software, and to permit third-parties to whom the Software is furnished to
10 do so, all subject to the following:
11 
12 The copyright notices in the Software and this entire statement, including
13 the above license grant, this restriction and the following disclaimer,
14 must be included in all copies of the Software, in whole or in part, and
15 all derivative works of the Software, unless such copies or derivative
16 works are solely in the form of machine-executable object code generated by
17 a source language processor.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
22 SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
23 FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
24 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25 DEALINGS IN THE SOFTWARE.
26 
27 */
28 
29 module derelict.glib.gchecksum;
30 
31 import derelict.glib.gtypes;
32 import derelict.glib.glibconfig;
33 import core.stdc.config;
34 
35 extern (C):
36 
37 alias _Anonymous_0 GChecksumType;
38 alias _GChecksum GChecksum;
39 
40 enum _Anonymous_0
41 {
42 	G_CHECKSUM_MD5 = 0,
43 	G_CHECKSUM_SHA1 = 1,
44 	G_CHECKSUM_SHA256 = 2
45 }
46 
47 struct _GChecksum;
48 
49 version(Derelict_Link_Static)
50 {
51     extern( C ) nothrow 
52     {
53         gssize g_checksum_type_get_length(GChecksumType checksum_type);
54         GChecksum* g_checksum_new(GChecksumType checksum_type);
55         void g_checksum_reset(GChecksum* checksum);
56         GChecksum* g_checksum_copy(const(GChecksum)* checksum);
57         void g_checksum_free(GChecksum* checksum);
58         void g_checksum_update(GChecksum* checksum, const(guchar)* data, gssize length);
59         const(gchar)* g_checksum_get_string(GChecksum* checksum);
60         void g_checksum_get_digest(GChecksum* checksum, guint8* buffer, gsize* digest_len);
61         gchar* g_compute_checksum_for_data(GChecksumType checksum_type, const(guchar)* data, gsize length);
62         gchar* g_compute_checksum_for_string(GChecksumType checksum_type, const(gchar)* str, gssize length);
63     }
64 }
65 else
66 {
67     extern( C ) nothrow 
68     {
69         alias da_g_checksum_type_get_length = gssize function(GChecksumType checksum_type);											
70         alias da_g_checksum_new = GChecksum* function(GChecksumType checksum_type);													
71         alias da_g_checksum_reset = void function(GChecksum* checksum);																
72         alias da_g_checksum_copy = GChecksum* function(const(GChecksum)* checksum);													
73         alias da_g_checksum_free = void function(GChecksum* checksum);																
74         alias da_g_checksum_update = void function(GChecksum* checksum, const(guchar)* data, gssize length);						
75         alias da_g_checksum_get_string = const(gchar)* function(GChecksum* checksum);												
76         alias da_g_checksum_get_digest = void function(GChecksum* checksum, guint8* buffer, gsize* digest_len);						
77         alias da_g_compute_checksum_for_data = gchar* function(GChecksumType checksum_type, const(guchar)* data, gsize length);		
78         alias da_g_compute_checksum_for_string = gchar* function(GChecksumType checksum_type, const(gchar)* str, gssize length);	
79     }
80 
81     __gshared
82     {
83         da_g_checksum_type_get_length g_checksum_type_get_length; 
84         da_g_checksum_new g_checksum_new; 
85         da_g_checksum_reset g_checksum_reset; 
86         da_g_checksum_copy g_checksum_copy; 
87         da_g_checksum_free g_checksum_free; 
88         da_g_checksum_update g_checksum_update; 
89         da_g_checksum_get_string g_checksum_get_string; 
90         da_g_checksum_get_digest g_checksum_get_digest; 
91         da_g_compute_checksum_for_data g_compute_checksum_for_data; 
92         da_g_compute_checksum_for_string g_compute_checksum_for_string; 
93     }
94 }